Option Strict Off
Option Explicit On
Namespace BMLERP
	Friend Class FrmReportDateRange
		Inherits System.Windows.Forms.Form


		Private Sub bdate_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles bdate.KeyPress
			Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
			If KeyAscii = 13 Then
				edate.Focus()
			ElseIf KeyAscii = 27 Then
				Reportflg = False
				Me.Close()
				'Unload frmINV200
			End If
			eventArgs.KeyChar = Chr(KeyAscii)
			If KeyAscii = 0 Then
				eventArgs.Handled = True
			End If
		End Sub



		Private Sub edate_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles edate.KeyPress
			Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
			If KeyAscii = 13 Then
				If IsDBNull(bdate.Text) Or IsDBNull(edate.Text) Then
					MsgBox("You must enter both beginning and ending dates.")
					bdate.Focus()
				Else
					If bdate.Text > edate.Text Then
						MsgBox("Ending date must be greater than Beginning date.")
						bdate.Focus()
					Else
						Me.Visible = False
					End If
				End If
			ElseIf KeyAscii = 27 Then
				Reportflg = False
				Me.Close()
			End If
			eventArgs.KeyChar = Chr(KeyAscii)
			If KeyAscii = 0 Then
				eventArgs.Handled = True
			End If
		End Sub


		Private Sub FrmReportDateRange_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
			Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
			If KeyAscii = 27 Then
				Me.Close()
				frmINV200.Close()
			End If
			eventArgs.KeyChar = Chr(KeyAscii)
			If KeyAscii = 0 Then
				eventArgs.Handled = True
			End If
		End Sub

		Private Sub FrmReportDateRange_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
			Me.Option1.Checked = True
		End Sub

		Private Sub OKButton_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles OKButton.Click
			If IsDBNull(bdate.Text) Or IsDBNull(edate.Text) Then
				MsgBox("You must enter both beginning and ending dates.")
				bdate.Focus()
			Else
				If bdate.Text > edate.Text Then
					MsgBox("Ending date must be greater than Beginning date.")
					bdate.Focus()
				Else
					Me.Visible = False
				End If
			End If
		End Sub

		Private Sub Option1_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles Option1.KeyPress
			Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
			If KeyAscii = 27 Then
				Reportflg = False
				Me.Close()
			End If
			eventArgs.KeyChar = Chr(KeyAscii)
			If KeyAscii = 0 Then
				eventArgs.Handled = True
			End If
		End Sub

		Private Sub Option2_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles Option2.KeyPress
			Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
			If KeyAscii = 27 Then
				Reportflg = False
				Me.Close()
			End If
			eventArgs.KeyChar = Chr(KeyAscii)
			If KeyAscii = 0 Then
				eventArgs.Handled = True
			End If
		End Sub
	End Class
End Namespace